<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://www.ecside.org" prefix="ec"%>
<%-- <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> --%>
<%@ page import="java.util.*"%>
<%@ page import="com.agileai.domain.DataRow"%>
<jsp:useBean id="pageBean" scope="request" class="com.agileai.hotweb.domain.PageBean"/>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>项目追踪</title>
<%@include file="/jsp/inc/resource.inc.jsp"%>
<script type="text/javascript" src="aeditors/xheditor/xheditor-1.2.2.min.js"></script>
<script type="text/javascript" src="aeditors/xheditor/xheditor_lang/zh-cn.js"></script>
<script type="text/javascript" src="js/jquery.hotkeys.js"></script>
</head>
<style>
.table-button-position{
	float: right;
}
.weekly-text{
	text-align: center;
}
.summary-td{
	    background: yellow;
}
.title-tr{
    background: green;
    color: #ffffff;
 }
.week-div table{
	border-collapse:collapse;
	font-weight: bold;
	border:
}
.week-div{
	position: relative;
    border: 0px solid rgba(34, 112, 184, 0.84);
    margin-bottom: 20px;
}
#__ToolBar__ {
    display: block;
    position: absolute;
    margin-left: 85%; 
    margin-top: -3px;
}

#form1 {
    min-height: 10% !important
}
#filterBox{
    background: white;
    border: 1px solid #b5cfe6;
    width: 255px !important;
    height: 100px;
    text-align: center;

}
#filterBox span {
 
}
.prompt-span{
	color: rgb(0, 51, 102);
	font-weight: bold;
}
.filter-table{
    width: 95%;
    margin-top: 10px;
    margin-left: 7px;
   	border-collapse: collapse;
}
.filter-table td{
    border: 1px #d9d9d9 solid;
}
.filter-table td{
}
.filter-table-title{
}
.left-td{
 	 background: #e5effd;
    color: #62b1ff;
}
.right-td{
    background: #e5effd;
    color: #62b1ff;
}
.bartdx {
	width:30%;
}
.prompt-div{
    text-align: center;
    font-size: 23px;
    margin-top: 70px;
}
#__ParamBar__{
	margin-top: 10px;
    margin-bottom: -15px;
}
.title-span{
	background-image: url(images/box_header.png) !important;
    color: #FFF;
    font-weight: bold;
    display: inline-block;
    width: 50%;
    background: red;
    float: left;
    height: 22px;
    margin-bottom: 10px;}
.bartdx-change{
 line-height: 15px;
 height:15px !important;
 width:100px;
}
</style>
<body>
<form action="<%=pageBean.getHandlerURL()%>" name="form1" id="form1" method="post">
<%@include file="/jsp/inc/message.inc.jsp"%>

<div id="" style="position:fixed; left:0px;top:0px;background: #d9e9ff;width:100%;z-index: 100">
<table ><tr><td>
&nbsp;开始日期<input id="pptStartDate" label="日期" size="6" name="pptStartDate" type="text" value="<%=pageBean.inputDate("pptStartDate")%>" size="24" class="text" /><img id="pptStartDatePicker" src="images/calendar.gif" width="16" height="16" style="vertical-align: sub;" alt="日期/时间选择框" />
&nbsp;结束日期<input id="pptDate" label="日期" size="6" name="pptDate" type="text" value="<%=pageBean.inputDate("pptDate")%>" size="24" class="text" /><img id="pptDatePicker" src="images/calendar.gif" width="16" height="16" style="vertical-align: sub;" alt="日期/时间选择框" />

&nbsp;&nbsp;<input type="button" name="button" id="button" value="查询" class="formbutton" onclick="doQuery()" />
 </tr></table>

<div style=" text-align: center;">
	<div id="filterBox" class="sharp color2" style="display: none;position:absolute;top:30px; z-index:10; width:480px;">
	<span class="title-span">设置展示条数</span>
	<table class="filter-table">
		<tr>
			<td class="left-td"><span class="prompt-span">展示记录数</span></td>
			<td class="right-td"><input id="weekNum" label="周数" name="weekNum" type="text" value="<%=pageBean.inputValue("weekNum")%>" size="10" class="text" style="text-align: center;float: left;" /></td>
		</tr>
	</table>
	<p>
	<input type="button"  name="button" id="button" value="确认" class="formbutton" onclick="setWeekNum();"  /> &nbsp;&nbsp;&nbsp;&nbsp;
	<input type="button" name="button" id="button" value="关闭" class="formbutton" onclick="resWeekNum();javascript:$('#filterBox').hide();" /> 
	</div>
</div>
</div>
<script>
 function showFilterBox(){
	 	$("#weekNum").val($("#weekNumShow").html())
		$('#filterBox').show();
		var clientWidth = $(document.body).width();
		var tuneLeft = (clientWidth - $("#filterBox").width())/2-2;	
		$("#filterBox").css('left',tuneLeft);	
}
 function clearFilter(){
		$("#filterBox input[type!='button'],select").val('');
}
 function setWeekNum(){
	 if(!isNaN($('#weekNum').val())){
		 $("#weekNumShow").html($("#weekNum").val())
		 $('#filterBox').hide();
		 return;
	 }
	 $("#weekNum").val($("#weekNumShow").html())
	 jAlert("只能是数字类型")
 }
 function  resWeekNum(){
	 $("#weekNum").val($("#weekNumShow").html()) 
 }
$(function(){
	$("#weekNumShow").text('<%=pageBean.inputValue("weekNum")%>')
}) 
 </script>
 
 </form>
 
 <%  List<DataRow> rslist = (List<DataRow>)pageBean.getRsList();
	 int paramSize = pageBean.listSize();
     for(int i=0;i<paramSize;i++){%>  
		<form id="weekInfoForm<%=i%>" name="weeklyForm<%=i%>" method="post" action="<%=pageBean.getHandlerURL()%>">
			<input type="hidden" name="actionType" id="noteActionType<%=i%>"/> 
			 <div class="week-div" onmouseover="changeClass(this,'xheditor',<%=i%>)" onmouseout="changeClass(this,'mini',<%=i%>)">
				<div id="__ToolBar__" style="float:right;padding-right: 10px;right;padding-top: 4px;">
					<table border="0" cellpadding="0" id="button-tb-${status.index}" cellspacing="1">
						<tbody>
							<tr>
							<%if("TRACK_INITIALIZATION".equals(pageBean.inputValue(i,"PPT_STATE"))){%>
								<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx bartdx-change" align="center" onclick="saveWeekInfo( 'weekInfoForm'+<%=i%>,<%=i%>)">
								<input value="&nbsp;" type="button" class="saveImgBtn" id="saveImgBtn" title="保存">保存</td>
								
								<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx bartdx-change" align="center" onclick="saveWeekInfo( 'weekInfoForm'+<%=i%>,<%=i%>)">
								<input value="&nbsp;" type="button" class="saveImgBtn" id="saveImgBtn" title="保存">提交</td>
							
							<%}%>
							<%if("TRACK_SUMBIT".equals(pageBean.inputValue(i,"PPT_STATE"))){%>	
								<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx bartdx-change" align="center" onclick="saveWeekInfo( 'weekInfoForm'+<%=i%>,<%=i%>)">
								<input value="&nbsp;" type="button" class="saveImgBtn" id="saveImgBtn" title="保存">确认</td>
							<%}%>
							<%if("TRACK_CONFIRM".equals(pageBean.inputValue(i,"PPT_STATE"))){%>		
								<td onmouseover="onMover(this);" onmouseout="onMout(this);" class="bartdx bartdx-change" align="center" onclick="saveWeekInfo( 'weekInfoForm'+<%=i%>,<%=i%>)">
								<input value="&nbsp;" type="button" class="saveImgBtn" id="saveImgBtn" title="保存">反提交</td>
							<%}%>
							</tr>
						</tbody>
					</table>
				</div>
				<input type="label" name="pptName" id="pptName" value="<%=pageBean.inputValue(i,"PPT_NAME")%>"/>
				<textarea style="width:100%;"  id="TW_CONTENT_" name="TW_CONTENT" cols="45" rows="5" class="xheditor {skin:'o2007blue',tools:'Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,List,Outdent,Indent,Link,Unlink,Fullscreen'}"><%=pageBean.inputValue(i,"PPT_DESCRIBE")%></textarea>
				<table border="1" width="100%">
					<tr class="title-tr">
						  <th width="20%" height="27">时间 </th>
						  <th width="40%">内容说明</th>
						  <th >人天</th>
						  <th width="385">备注</th>
					  </tr>
					  <tr>
					  <%int trackListSize=Integer.valueOf(pageBean.inputValue(i,"trackListSize")); %>
				    	  <td rowspan='<%=trackListSize+1%>'><div class="weekly-text"><%=pageBean.inputValue(i,"PWI_NAME")%></div></td>
				      </tr>
				   	  <% List<DataRow> list= (List<DataRow>)pageBean.getAttribute(i, "trackList");
		     	 	  for(int j=0;j<list.size();j++){
		     			DataRow row=(DataRow)list.get(j);
		    		  %>
				      <tr>
					      <td><%=row.getString("PTD_CONTENT_INFO")%></td>
					      <td><%=row.get("PTD_ONE_DAY")%></td>
					      <td>  <input type="hidden" name="ptdId_<%=j%>" id="ptdId__<%=j%>" value='<%=row.get("PTD_ID")%>'/>
					       		<textarea id="ptdSummary_<%=j%>" rows="1" name="ptdSummary_<%=j%>" style="width:98%;border:0;resize: vertical;overflow: hidden;"   ><%=row.get("PTD_SUMMARY")%></textarea>
					      </td>
				      </tr>
				      <%}%>
				      <tr style="height:26px">
				    	<th class="summary-td" >总结</td>
				    	<th colspan="3" class="weekly-text summary-td">本周共投入<%=pageBean.inputValue(i,"PPT_ONE_DAY")%>人天，剩余<%=pageBean.inputValue(i,"PPT_SUM_DAY")%>-<%=pageBean.inputValue(i,"PPT_ONE_DAY")%>=<span style=" color: red;"><%=pageBean.inputValue(i,"PPT_SURPLUS")%></span>人天</td>
				   	  </tr>
				</table>
			</div>
			<input type="hidden" name="trackSize" id="trackSize" value="<%=pageBean.inputValue(i,"trackListSize")%>"/>
			<input type="hidden" name="pptId" id="pptId" value="<%=pageBean.inputValue(i,"PPT_ID")%>"/>
			<input type="hidden" name="pptState" id="pptState" value="<%=pageBean.inputValue(i,"PPT_STATE")%>"/>
		    <input type="hidden" name="operaType" id="operaType" value="update"/>
		</form>
<%}%>
<%if(paramSize==0){%><div class="prompt-div">没有追踪记录</div><%}%>
<script language="JavaScript">
setRsIdTag('PPT_ID');
var ectableMenu = new EctableMenu('contextMenu','ec_table');
initCalendar('pptDate','%Y-%m-%d','pptDatePicker');
initCalendar('pptStartDate','%Y-%m-%d','pptStartDatePicker');

$(function(){
	 for(var i=0;i<<%=rslist.size()%>;i++){
	 	$("#button-tb-"+i).hide(); 
	 }
})
function changeClass(flag,index){
	if(flag=="mini"){
		 $("#button-tb-"+index).hide(); 
	}
	if(flag=="xheditor"){
		$("#button-tb-"+index).show();
	} 
}
function saveWeekInfo(formId,index){
		actionTypeTagId = "noteActionType"+index;
		postRequest(formId,{actionType:'saveWeekInfo',showSplash:true,onComplete:function(responseText){
			hideSplash();
			if (responseText == 'success'){
				 jAlert("保存成功！")
			}else{
				jAlert("保存失败！")
			}
		}});
}
function subimtWeekInfo(obj,formId,index){
	actionTypeTagId = "noteActionType"+index;
	 var r=confirm("确认提交吗？")
	  if (r==true){
		  	postRequest(formId,{actionType:'subimtWeekInfo',showSplash:true,onComplete:function(responseText){
		  	hideSplash();
			if (responseText == 'success'){
				jAlert("提交成功！","信息提示",function(){
					doSubmit({actionType:'prepareDisplay'});
				})
			}else{
				jAlert("提交失败！")
			}
		}});
	}  
}
  
</script>

</body>
</html>
<%@include file="/jsp/inc/scripts.inc.jsp"%>
